//包含基于多个state的getter计算属性的对象
export default {
    totalCount(state) {
        return state.cartFoods.reduce((preTatal, food) => preTatal + food.count, 0)
    },
    totalPrice(state) {
        return state.cartFoods.reduce((preTatal, food) => preTatal + food.count * food.price, 0)
    },
    positiveSize(state) {
        return state.ratings.reduce((preTatal, ratings) => preTatal + (ratings.rateType === 0 ? 1 : 0), 0)
    }
}   